/**
 ******************************* ICE *******************************
 * ========================================================================
 * Project:		iceservices
 * Package:		org.ice4apps.service
 * File:		IceServiceLocator.java
 * Author: 		robin
 * Date: 		Feb 11, 2010
 * Description:	
 * ========================================================================
 * 
 */

package org.ice4apps.service;

import javax.naming.InitialContext;

public final class IceServiceLocator {
    private static IceSystemServiceLocal system = null;
    private static IceEnterpriseServiceLocal enterprise = null;
    
    public static IceSystemServiceLocal getIceSystemService () throws Exception {
        if (system == null){
            InitialContext ctx = new InitialContext();  
            system = (IceSystemServiceLocal)ctx.lookup ("IceSystemService/local");
        }
        return system;
    }
    
    public static IceEnterpriseServiceLocal getIceEnterpriseService () throws Exception {
        if (enterprise == null){
            InitialContext ctx = new InitialContext();  
            enterprise = (IceSystemServiceLocal)ctx.lookup ("IceEnterpriseService/local");
        }
        return enterprise;
    }
}
